{include file="admin/header.htm"}
<table align="center" cellpadding="0" cellspacing="1" class="table_list">
    <caption><?=$parentid && $parentname ? '['.$parentname.'] 子' : ''?>菜单管理</caption>
    <tr>
        <th width="5%">id</th>
        <th width="30%">名称</th>
        <th width="5%">类型</th>
        <th width="30%">管理操作</th>
    </tr>
    
    {foreach $menus as $menu}
    <tr>
        <td class="align_c">{$menu.id}</td>
        <td><a href="">{$menu.menu_name}</a></td>
        <td class="align_c">{if $menu.isdir eq 1}目录{else}链接{/if}</td>
        <td class="align_c">
            {if $menu.isdir eq 1}<a href="{$smarty.const.ADMIN_NAME}?m=admin&c=menu&a=manage&pid={$menu.id}">子菜单</a> | {/if}<a href="{$smarty.const.ADMIN_NAME}?m=admin&c=menu&a=add&id={$menu.id}">修改</a> | <a href="javascript:deleteConfirm('{$smarty.const.ADMIN_NAME}?m=admin&c=menu&a=manage&op=delete&id={$menu.id}&pid={$pid}')">删除</a>
        </td>
    </tr>
    {/foreach}
</table>
{include file="admin/footer.htm"}
<script language="javascript">
function deleteConfirm(url) {
    if(window.confirm('删除此菜单将同时删除它的子菜单！确定删除吗？')) {
        location.href = url;
    }
}
</script>